Component({
  /**
   * 组件的初始数据
   */
  properties: {
    active: {
      type: Number,
      value: 0,
      observer(val) {
        // console.log('active', val);
      },
    },
    userInfo: {
      type: Object,
      value: {},
    },
  },
  data: {
  },
  methods: {
    onChange(e) {
      const obj = {
        0: '/pages/home/home',
        1: '/pages/me/me',
      };
      wx.switchTab({
        url: obj[e.detail],
      });
      // this.setData({ active: e.detail });
    },
    toBookStep() {
      // wx.reLaunch({
      wx.navigateTo({
        url: `/pages/book-step/book-step`,
      });
    },
    toTask() {
      wx.navigateTo({
      // wx.reLaunch({
        url: `/pages/mytask/mytask`,
      });
    },
  },
});
